//
//  secVc.m
//  xibDemo
//
//  Created by wanglei on 17/2/4.
//  Copyright © 2017年 wanglei. All rights reserved.
//

#import "secVc.h"

@interface secVc ()
@property (weak, nonatomic) IBOutlet UIView *colorView;

@end

@implementation secVc




// 对应控制器的xib的入口方法
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) { 
        [self setupUi];
    }
    return self;
}


- (void)setupUi{
    self.view.backgroundColor = [UIColor clearColor];
    NSLog(@"调用了secVc");
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(50, 500, 100, 50)];
    [btn setTitle:@"返回" forState:UIControlStateNormal];
    
    [btn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:btn];
    
}

- (void)back{

    [self dismissViewControllerAnimated:YES completion:nil];
}

//设置约束
- (void)viewDidLayoutSubviews{
    
    self.view.frame = CGRectMake(0, 0, 375, 667);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}






@end
